package com.wm.youfangtong.base

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.viewbinding.ViewBinding

/**
 * author: wu-meng
 * date  : 2023/12/8
 * desc  : BaseActivity
 */
abstract class BaseActivity<T: ViewBinding> : AppCompatActivity() {

    private var binding: T? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        binding = bindView()

        setContentView(binding?.root)

        initView()
        initData()
        initListener()
        observeData()
    }

    protected abstract fun bindView() : T

    protected abstract fun initView()

    protected abstract fun initData()

    protected abstract fun initListener()

    protected abstract fun observeData()

}